#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "shapeItem.h"
#include "shape_dll.h"
#include <QWidget>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QPushButton>
#include <QTextEdit>
#include <QMessageBox>
#include <QKeyEvent>
#include <QList>



class MainWindow : public QWidget
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    void ReadData(shapeItem *item);
    void PaintFromFile(shapeItem *item, Shape *fig);
    void loadingInf();
    int x,y;
    void mouseDoubleClickEvent(QMouseEvent *event);
    void keyPressEvent(QKeyEvent *event);
    ~MainWindow();
private:
    ShapeConteiner conteinerOfShape;
    QGraphicsScene *scene;
    QGraphicsView * graphicsView;
    QList<shapeItem*> listOfItem;

    QPushButton *rectangleButton;
    QPushButton *triangleButton;
    QPushButton *circleButton;
    //QPushButton *removeShapeButton;
    QPushButton *clearButton;

    QTextEdit *text;
    QTextEdit *a;
    QTextEdit *b;

    QMessageBox msgBox;
    QMessageBox msgBoxLoad;

    int numberOfShape;

private slots:
    void createItem();
    void TriangleSetButtonEnabled();
    void RectangleSetButtonEnabled();
    void CircleSetButtonEnabled();
    void ClearScene();
    //void RemoveFigure();


};


#endif // MAINWINDOW_H
